package com.zzx.common.enums;

/**
 * 用户账户类型
 **/
public enum UserTypeEnum {
    SYSTEM_ADMIN(0,"系统管理员"),
    SUPER_ADMIN(1,"超级管理员"),
    ADMIN(2,"门店管理员"),
    WORKER(3,"工作人员");


    private int type;
    private String name;

    UserTypeEnum(int type, String name) {
        this.type = type;
        this.name = name;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public static UserTypeEnum findType(Integer index){
        if (index != null) {
            //获取所有的部门
            UserTypeEnum[] values = UserTypeEnum.values();
            for (UserTypeEnum value : values) {
                if ( value.getType()==index){
                    return value;
                }
            }
        }
        return null;
    }
}
